Optimal. Leaf size=248 \[ -\frac{4 b^4 \left (2 a^2-b^2\right ) \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{a^3 d \left (a^2-b^2\right )^{5/2}}-\frac{2 b^4 \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{a d \left (a^2-b^2\right )^{5/2}}-\frac{b^5 \cos (c+d x)}{a^2 d \left (a^2-b^2\right )^2 (a+b \sin (c+d x))}+\frac{2 b \tanh ^{-1}(\cos (c+d x))}{a^3 d}-\frac{\cot (c+d x)}{a^2 d}+\frac{\cos (c+d x)}{2 d (a+b)^2 (1-\sin (c+d x))}-\frac{\cos (c+d x)}{2 d (a-b)^2 (\sin (c+d x)+1)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.372225, antiderivative size = 248, normalized size of antiderivative = 1., number of steps used = 15, number of rules used = 10, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.345, Rules used = {2897, 3770, 3767, 8, 2648, 2664, 12, 2660, 618, 204} \[ -\frac{4 b^4 \left (2 a^2-b^2\right ) \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{a^3 d \left (a^2-b^2\right )^{5/2}}-\frac{2 b^4 \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{a d \left (a^2-b^2\right )^{5/2}}-\frac{b^5 \cos (c+d x)}{a^2 d \left (a^2-b^2\right )^2 (a+b \sin (c+d x))}+\frac{2 b \tanh ^{-1}(\cos (c+d x))}{a^3 d}-\frac{\cot (c+d x)}{a^2 d}+\frac{\cos (c+d x)}{2 d (a+b)^2 (1-\sin (c+d x))}-\frac{\cos (c+d x)}{2 d (a-b)^2 (\sin (c+d x)+1)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2897
Rule 3770
Rule 3767
Rule 8
Rule 2648
Rule 2664
Rule 12
Rule 2660
Rule 618
Rule 204
Rubi steps
\begin{align*} \int \frac{\csc ^2(c+d x) \sec ^2(c+d x)}{(a+b \sin (c+d x))^2} \, dx &=\int \left (-\frac{2 b \csc (c+d x)}{a^3}+\frac{\csc ^2(c+d x)}{a^2}-\frac{1}{2 (a+b)^2 (-1+\sin (c+d x))}+\frac{1}{2 (a-b)^2 (1+\sin (c+d x))}-\frac{b^4}{a^2 \left (a^2-b^2\right ) (a+b \sin (c+d x))^2}-\frac{2 b^4 \left (2 a^2-b^2\right )}{a^3 \left (a^2-b^2\right )^2 (a+b \sin (c+d x))}\right ) \, dx\\ &=\frac{\int \csc ^2(c+d x) \, dx}{a^2}+\frac{\int \frac{1}{1+\sin (c+d x)} \, dx}{2 (a-b)^2}-\frac{(2 b) \int \csc (c+d x) \, dx}{a^3}-\frac{\int \frac{1}{-1+\sin (c+d x)} \, dx}{2 (a+b)^2}-\frac{b^4 \int \frac{1}{(a+b \sin (c+d x))^2} \, dx}{a^2 \left (a^2-b^2\right )}-\frac{\left (2 b^4 \left (2 a^2-b^2\right )\right ) \int \frac{1}{a+b \sin (c+d x)} \, dx}{a^3 \left (a^2-b^2\right )^2}\\ &=\frac{2 b \tanh ^{-1}(\cos (c+d x))}{a^3 d}+\frac{\cos (c+d x)}{2 (a+b)^2 d (1-\sin (c+d x))}-\frac{\cos (c+d x)}{2 (a-b)^2 d (1+\sin (c+d x))}-\frac{b^5 \cos (c+d x)}{a^2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))}-\frac{b^4 \int \frac{a}{a+b \sin (c+d x)} \, dx}{a^2 \left (a^2-b^2\right )^2}-\frac{\operatorname{Subst}(\int 1 \, dx,x,\cot (c+d x))}{a^2 d}-\frac{\left (4 b^4 \left (2 a^2-b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac{1}{2} (c+d x)\right )\right )}{a^3 \left (a^2-b^2\right )^2 d}\\ &=\frac{2 b \tanh ^{-1}(\cos (c+d x))}{a^3 d}-\frac{\cot (c+d x)}{a^2 d}+\frac{\cos (c+d x)}{2 (a+b)^2 d (1-\sin (c+d x))}-\frac{\cos (c+d x)}{2 (a-b)^2 d (1+\sin (c+d x))}-\frac{b^5 \cos (c+d x)}{a^2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))}-\frac{b^4 \int \frac{1}{a+b \sin (c+d x)} \, dx}{a \left (a^2-b^2\right )^2}+\frac{\left (8 b^4 \left (2 a^2-b^2\right )\right ) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac{1}{2} (c+d x)\right )\right )}{a^3 \left (a^2-b^2\right )^2 d}\\ &=-\frac{4 b^4 \left (2 a^2-b^2\right ) \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{a^3 \left (a^2-b^2\right )^{5/2} d}+\frac{2 b \tanh ^{-1}(\cos (c+d x))}{a^3 d}-\frac{\cot (c+d x)}{a^2 d}+\frac{\cos (c+d x)}{2 (a+b)^2 d (1-\sin (c+d x))}-\frac{\cos (c+d x)}{2 (a-b)^2 d (1+\sin (c+d x))}-\frac{b^5 \cos (c+d x)}{a^2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))}-\frac{\left (2 b^4\right ) \operatorname{Subst}\left (\int \frac{1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac{1}{2} (c+d x)\right )\right )}{a \left (a^2-b^2\right )^2 d}\\ &=-\frac{4 b^4 \left (2 a^2-b^2\right ) \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{a^3 \left (a^2-b^2\right )^{5/2} d}+\frac{2 b \tanh ^{-1}(\cos (c+d x))}{a^3 d}-\frac{\cot (c+d x)}{a^2 d}+\frac{\cos (c+d x)}{2 (a+b)^2 d (1-\sin (c+d x))}-\frac{\cos (c+d x)}{2 (a-b)^2 d (1+\sin (c+d x))}-\frac{b^5 \cos (c+d x)}{a^2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))}+\frac{\left (4 b^4\right ) \operatorname{Subst}\left (\int \frac{1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac{1}{2} (c+d x)\right )\right )}{a \left (a^2-b^2\right )^2 d}\\ &=-\frac{2 b^4 \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{a \left (a^2-b^2\right )^{5/2} d}-\frac{4 b^4 \left (2 a^2-b^2\right ) \tan ^{-1}\left (\frac{b+a \tan \left (\frac{1}{2} (c+d x)\right )}{\sqrt{a^2-b^2}}\right )}{a^3 \left (a^2-b^2\right )^{5/2} d}+\frac{2 b \tanh ^{-1}(\cos (c+d x))}{a^3 d}-\frac{\cot (c+d x)}{a^2 d}+\frac{\cos (c+d x)}{2 (a+b)^2 d (1-\sin (c+d x))}-\frac{\cos (c+d x)}{2 (a-b)^2 d (1+\sin (c+d x))}-\frac{b^5 \cos (c+d x)}{a^2 \left (a^2-b^2\right )^2 d (a+b \sin (c+d x))}\\ \end{align*}
Mathematica [A] time = 3.23369, size = 254, normalized size = 1.02 \[ \frac{\frac{4 b^4 \left (2 b^2-5 a^2\right ) \tan ^{-1}\left (\frac{a \tan \left (\frac{1}{2} (c+d x)\right )+b}{\sqrt{a^2-b^2}}\right )}{a^3 \left (a^2-b^2\right )^{5/2}}-\frac{2 b^5 \cos (c+d x)}{a^2 (a-b)^2 (a+b)^2 (a+b \sin (c+d x))}-\frac{4 b \log \left (\sin \left (\frac{1}{2} (c+d x)\right )\right )}{a^3}+\frac{4 b \log \left (\cos \left (\frac{1}{2} (c+d x)\right )\right )}{a^3}+\frac{\tan \left (\frac{1}{2} (c+d x)\right )}{a^2}-\frac{\cot \left (\frac{1}{2} (c+d x)\right )}{a^2}+\frac{2 \sin \left (\frac{1}{2} (c+d x)\right )}{(a+b)^2 \left (\cos \left (\frac{1}{2} (c+d x)\right )-\sin \left (\frac{1}{2} (c+d x)\right )\right )}+\frac{2 \sin \left (\frac{1}{2} (c+d x)\right )}{(a-b)^2 \left (\sin \left (\frac{1}{2} (c+d x)\right )+\cos \left (\frac{1}{2} (c+d x)\right )\right )}}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.159, size = 346, normalized size = 1.4 \begin{align*}{\frac{1}{2\,d{a}^{2}}\tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) }-{\frac{1}{d \left ( a+b \right ) ^{2}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) -1 \right ) ^{-1}}-2\,{\frac{{b}^{6}\tan \left ( 1/2\,dx+c/2 \right ) }{d \left ( a-b \right ) ^{2} \left ( a+b \right ) ^{2}{a}^{3} \left ( \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}a+2\,\tan \left ( 1/2\,dx+c/2 \right ) b+a \right ) }}-2\,{\frac{{b}^{5}}{d \left ( a-b \right ) ^{2} \left ( a+b \right ) ^{2}{a}^{2} \left ( \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) ^{2}a+2\,\tan \left ( 1/2\,dx+c/2 \right ) b+a \right ) }}-10\,{\frac{{b}^{4}}{d \left ( a-b \right ) ^{2} \left ( a+b \right ) ^{2}a\sqrt{{a}^{2}-{b}^{2}}}\arctan \left ( 1/2\,{\frac{2\,a\tan \left ( 1/2\,dx+c/2 \right ) +2\,b}{\sqrt{{a}^{2}-{b}^{2}}}} \right ) }+4\,{\frac{{b}^{6}}{d \left ( a-b \right ) ^{2} \left ( a+b \right ) ^{2}{a}^{3}\sqrt{{a}^{2}-{b}^{2}}}\arctan \left ( 1/2\,{\frac{2\,a\tan \left ( 1/2\,dx+c/2 \right ) +2\,b}{\sqrt{{a}^{2}-{b}^{2}}}} \right ) }-{\frac{1}{d \left ( a-b \right ) ^{2}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) +1 \right ) ^{-1}}-{\frac{1}{2\,d{a}^{2}} \left ( \tan \left ({\frac{dx}{2}}+{\frac{c}{2}} \right ) \right ) ^{-1}}-2\,{\frac{b\ln \left ( \tan \left ( 1/2\,dx+c/2 \right ) \right ) }{d{a}^{3}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 7.63576, size = 2925, normalized size = 11.79 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.32381, size = 706, normalized size = 2.85 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]